package com.rockcent.mall.lib.domain;

import com.rockcent.common.domain.IDEntityMall;
import com.rockcent.common.domain.enumclass.Whether;
import com.rockcent.mall.lib.domain.enumclass.MallMemberFundTransactionType;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 会员账号资金记录
 * Created by zhangjh on 2017/03/07.
 */
@Entity
@Table(name = "mall_member_fund_flow")
@DynamicInsert(value = true)
@DynamicUpdate(value = true)
public class MallMemberFundFlow extends IDEntityMall {
    /**
     * 流水号
     */
    @Column(columnDefinition = "varchar(100) comment '流水号'")
    private String seqNo;

    /**
     * 平台ID
     */
    @Column(columnDefinition = "bigint(20) comment '平台ID'")
    private Long mallId;

    /**
     * 会员账号ID
     */
    @Column(columnDefinition = "bigint(20) comment '平台商户ID'")
    private Long mallMemberId;


    /**
     * 交易类型
     */
    @Column(columnDefinition = "varchar(30) comment '交易类型  ALL(\"全部类型\"),OUTLINE_RECHARGE(\"线下充值\"),RECHARGE_PRESENTED(\"充值赠送\"),BASE_SERVICE_PAYMENTS(\"基础服务费扣费\"), MALL_EXCHANGE(\"平台交易佣金扣费\"), MERCHANT_SERVICE_PAYMENTS(\"商户服务费扣费\"), RECHARGE_COMMON(\"普通充值\")'")
    @Enumerated(EnumType.STRING)
    private MallMemberFundTransactionType transactionType;

    /**
     * 账户余额
     */
    @Column(columnDefinition = "DECIMAL(30,10) comment '账户余额'")
    private BigDecimal balance;


    /**
     * 金额
     */
    @Column(columnDefinition = "DECIMAL(30,10) comment '金额'")
    private BigDecimal operationAmount;


    /**
     * 备注
     */
    @Column(columnDefinition = "varchar(30)  comment '备注'")
    private String remark;


    public String getSeqNo() {
        return seqNo;
    }

    public void setSeqNo(String seqNo) {
        this.seqNo = seqNo;
    }

    public Long getMallId() {
        return mallId;
    }

    public void setMallId(Long mallId) {
        this.mallId = mallId;
    }

    public Long getMallMemberId() {
        return mallMemberId;
    }

    public void setMallMemberId(Long mallMemberId) {
        this.mallMemberId = mallMemberId;
    }

    public MallMemberFundTransactionType getTransactionType() {
        return transactionType;
    }

    public void setTransactionType(MallMemberFundTransactionType transactionType) {
        this.transactionType = transactionType;
    }

    public BigDecimal getBalance() {
        return balance;
    }

    public void setBalance(BigDecimal balance) {
        this.balance = balance;
    }

    public BigDecimal getOperationAmount() {
        return operationAmount;
    }

    public void setOperationAmount(BigDecimal operationAmount) {
        this.operationAmount = operationAmount;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Override
    public String toString() {
        return "MallMemberFundFlow{" +
                "id=" + id +
                ", seqNo='" + seqNo + '\'' +
                ", dateCreated=" + dateCreated +
                ", mallId=" + mallId +
                ", lastUpdated=" + lastUpdated +
                ", mallMemberId=" + mallMemberId +
                ", isDelete=" + isDelete +
                ", version=" + version +
                ", transactionType=" + transactionType +
                ", balance=" + balance +
                ", operationAmount=" + operationAmount +
                ", remark='" + remark + '\'' +
                '}';
    }
}
